#ifndef GLOBAL_DATA_H_
#define GLOBAL_DATA_H_

#include <semaphore.h>

/* Size of the circular buffers used for socket communication */
#define CIRCULAR_BUF_SIZE	10	
/* Size of the message */
#define	MESS_SIZE			1000

struct buff_struct {
	std::string			mess[CIRCULAR_BUF_SIZE];
	
	int					nextin;
	int					nextout;
	sem_t				empty_sem;
	sem_t				full_sem;
	sem_t				put_mutex; // @p
	sem_t				get_mutex; // @c
};
typedef struct buff_struct buff_t;


typedef struct global_struct {

	/* all received messages are stored in this buffer */
	buff_t				recv_buff;		
	/* messages that will be sent to Socket Engine */
	buff_t				send_buff;

	bool				quit_flag;

}global_s;
extern global_s global;


#endif /*GLOBAL_DATA_H_*/
